package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.dto.QueryPageBeanDTO;
import com.itheima.common.dto.SetmealDTO;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.Setmeal;
import com.itheima.pojo.SetmealData;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    /**
     * 添加套餐
     * @param setmeal
     */
    void insert(Setmeal setmeal);

    /**
     * 删除套餐
     * @param id
     */
    @Delete("delete from t_setmeal where id = #{id}")
    void deleteSetmealById(Integer id);

    /**
     * 修改套餐
     * @param setmeal
     */
    void update(Setmeal setmeal);

    /**
     * 根据id查询套餐
     * @param id
     * @return
     */
    @Select("select * from t_setmeal where id = #{id}")
    Setmeal getSetmealById(Integer id);

    /**
     * 分页查询
     * @param queryPageBean
     * @return
     */
    Page<Setmeal> pageSetmeal(QueryPageBean queryPageBean);

    /**
     * 获取所有数据
     * @return
     */
    @Select("select id, name,  sex, age, remark, img from t_setmeal")
    List<Setmeal> getData();
}
